package com.hjxr.xmgl.cfg;

import com.alibaba.fastjson.JSONArray;
//import com.hjxr.xmgl.analysis.cfg.domain.FieldVO;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

public class PageAnalysis {

    public static void main(String[] args){
        //由清册语句，生成对应的页面

        String json =
            "[" +
            "{name:'name','type':'string','align':'left','calculation':'','width':'120','height':'80'," +
            "title:'姓名','titleGroup':'','titleGroupTop':'','index':'1'}," +
            "{name:'age','type':'number','align':'right','calculation':'','width':'50','height':'80'," +
            "title:'年龄','titleGroup':'','titleGroupTop':'','index':'2'}," +
            "{name:'province','type':'string','align':'left','calculation':'','width':'100','height':'80'," +
            "title:'省','titleGroup':'配送地址:地址','titleGroupTop':'配送地址','index':'3'}," +
            "{name:'city','type':'string','align':'left','calculation':'','width':'100','height':'80'," +
            "title:'市区','titleGroup':'配送地址:地址','titleGroupTop':'配送地址','index':'4'}" +
            "]";

//        List<FieldVO> fieldList = JSONArray.parseArray(json, FieldVO.class);
//        System.out.println(fieldList);
//
//        fieldList.stream().sorted(Comparator.comparing(FieldVO::getIndex)) .collect(Collectors.toList());
//
//
//        List<FieldVO> genUiList = new ArrayList<>();

//        //分析标题
//        for(int i = 0; i< fieldList.size(); i++){
//
//            FieldVO field = fieldList.get(i);
//            String titleGroupTop = field.getTitleGroupTop();
//            String titleGroup = field.getTitleGroup();
//
//
//
//        }

    }

    private static void title(){

    }
}
